<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>从大到小排序</title>
</head>
<body>
    <script>
    var arr = new Array(70,35,67,4,20,59,98,100);
    var exchange = 0; 
    for(var i=1;i < arr.length;i++){
        for(var j=0;j < arr.length-i;j++){
            if(arr[j] < arr[j+1]){
                exchange = arr[j];
                arr[j]=arr[j+1];
                arr[j+1]=exchange;
            }
        }
    }
    alert(arr)
    alert(arr[0]);
    alert(arr[7]);
</script>
</body>
</html>